e42025b73fbece1d3fc4990252a289674de05016,platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java,ITNProxy,postNewThread,#String#String#ErrorBean#String#,103

Before Change


      os = "5";
    else
      os = "1";
    params.put("_os", os);

    params.put("_product", ApplicationNamesInfo.getInstance().getProductName());

    HttpURLConnection connection = post(NEW_THREAD_URL, params);
    int responce = connection.getResponseCode();

After Change


  public static int postNewThread (String userName, String password, ErrorBean error,
                                   String compilationTimestamp)
          throws IOException, NoSuchEAPUserException, InternalEAPException {
    @NonNls List<Pair<String,String>> params = new ArrayList<Pair<String, String>>();
    params.add(Pair.create("username", userName));
    params.add(Pair.create("pwd", password));
    params.add(Pair.create("_title", MessageFormat.format(THREAD_SUBJECT,
                                              error.getLastAction() == null ? error.getExceptionClass() :
                                              error.getLastAction() + ", " + error.getExceptionClass())));
    ApplicationInfoEx appInfo =
      (ApplicationInfoEx) ApplicationManager.getApplication().getComponent(
        ApplicationInfo.class);

    params.add(Pair.create("_build", appInfo.getBuild().asString()));
    params.add(Pair.create("_description",
               (compilationTimestamp != null ? ("Build time: " + compilationTimestamp + "\n") : "") +
               error.getDescription() + "\n\n" + error.getStackTrace()));

    String jdkVersion = SystemProperties.getJavaVersion();
    String jdkVendor = SystemProperties.getJavaVmVendor();

    if (jdkVendor.indexOf(SUN) != -1) {
      if (jdkVersion.equals(JDK_1_4_2))
        jdkVersion = "10";
      else if (jdkVersion.equals(JDK_1_4_1))
        jdkVersion = "7";
      else if (jdkVersion.equals(JDK_1_4_0_02))
        jdkVersion = "9";
      else if (jdkVersion.equals(JDK_1_4_0_01))
        jdkVersion = "8";
      else if (jdkVersion.equals(JDK_1_4_0))
        jdkVersion = "6";
      else if (jdkVersion.equals(JDK_1_3_1_01))
        jdkVersion = "5";
      else if (jdkVersion.equals(JDK_1_3_1))
        jdkVersion = "4";
      else if (jdkVersion.equals(JDK_1_3_0))
        jdkVersion = "3";
      else if (jdkVersion.equals(JDK_1_2_2))
        jdkVersion = "2";
      else
        jdkVersion = "1";
    } else
      jdkVersion = "1";

    params.add(Pair.create("_jdk", jdkVersion));

    String os = error.getOs();
    if (os == null)
      os = "";

    if (os.indexOf(WINDOWS_XP) != -1)
      os = "4";
    else if (os.indexOf(WINDOWS_2000) != -1 || os.indexOf(WINDOWS_NT) != -1)
      os = "3";
    else if (os.indexOf(WINDOWS_95) != -1 || os.indexOf(WINDOWS_98) != -1 || os.indexOf(WINDOWS_ME) != -1)
      os = "2";
    else if (os.indexOf(SOLARIS) != -1)
      os = "7";
    else if (os.indexOf(MAC_OS_X) != -1)
      os = "6";
    else if (os.indexOf(LINUX) != -1)
      os = "5";
    else
      os = "1";
    params.add(Pair.create("_os", os));

    params.add(Pair.create("_product", ApplicationNamesInfo.getInstance().getProductName()));

    for (Attachment attachment : error.getAttachments()) {
      params.add(Pair.create("_attachment_name", attachment.getName()));